package auctioncentral;

import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

/**
 * Tests the User classes constructors and methods.
 * 
 * @author Andres Rosales (acr)
 * @version 03/23/2014 acr
 */
public class UserTests {
	/**
	 * The Auction Central Staff user for testing.
	 */
	private AuCenStaffUser my_staff_member;
	
	/**
	 * The Authorized Non-Profit user for testing.
	 */
	private AuthNonProfitUser my_non_profit;
	
	/**
	 * The Bidder user for testing.
	 */
	private BiddingUser my_bidder;
	
	/**
	 * The bid to be used for testing.
	 */
	private Bid my_bid;
	
	
	/**
	 * Initializes all fields.
	 */
	@Before
	public void setup() {
		my_staff_member = new AuCenStaffUser("Keenan F.");
		my_non_profit = new AuthNonProfitUser("Kyle S.", "42 0th st.", "1357175317", "");
		my_bidder = new BiddingUser("Kris G.", "123 meep ln.", "1231231234", "1234", "herpaderp");
		my_bid = new Bid(100, "Kris G.", 123);
		my_bidder.placeBid(my_bid);
	}
	
	/**
	 * Tests all methods of users.
	 */
	@Test
	public void testUsers() {
		assertTrue(my_staff_member.getName().equals("Keenan F."));
		assertTrue(my_staff_member.getAddress().equals(""));
		assertTrue(my_staff_member.getPhoneNo().equals(""));
		
		assertTrue(my_non_profit.getName().equals("Kyle S."));
		assertTrue(my_non_profit.getAddress().equals("42 0th st."));
		assertTrue(my_non_profit.getPhoneNo().equals("1357175317"));
		
		assertTrue(my_bidder.getName().equals("Kris G."));
		assertTrue(my_bidder.getAddress().equals("123 meep ln."));
		//assertTrue(my_bidder.getPhoneNo().equals("1437269580"));
		assertTrue(my_bidder.getBids().contains(my_bid));
		assertTrue(my_bidder.getBillingAddress().equals("herpaderp"));
		assertTrue(my_bidder.getCardNo().equals("1234"));
	}

}
